package com.jkxt.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jkxt.controller.IndexController;
import com.jkxt.dao.RecordMapper;
import com.jkxt.model.Record;
import com.jkxt.service.IRecordService;


@Service("IRecordService")
public class RecordServiceImpl implements IRecordService {
	
	private RecordMapper recordMapper;

	public RecordMapper getRecordMapper() {
		return recordMapper;
	}
    @Autowired
	public void setRecordMapper(RecordMapper recordMapper) {
		this.recordMapper = recordMapper;
	}
	
	/**
	 * 记录健康信息  LZ
	 * @param record
	 * @return
	 */
	public int insertSelectiveService(Record record){
		return recordMapper.insertSelective(record);
	}
	
	/**
	 * 根据userId查询档案条数  LZ
	 * @param userId
	 * @param title
	 * @return
	 */
	public int countByUserIdService(Map map){
		return recordMapper.countByUserId(map);
	}
	
	/**
	 * 根据userId查询档案列表 LZ
	 * @param userId
	 * @param pageStart
	 * @param pageSize
	 * @param title
	 * @return
	 */
	public List<Record>  selectByUserIdService(Map map){
		return recordMapper.selectByUserId(map);
	}
	
	/**
	 * 根据ID和userID查询Record
	 * @param id
	 * @return
	 */
	public Record selectByUserIdAndIdService(Record record){
		return recordMapper.selectByUserIdAndId(record);
	}
	
	/**
	 * 根据ID更新Record
	 * @param record
	 * @return
	 */
	public int updateByIdAndUserIdService(Record record){
		return recordMapper.updateByIdAndUserId(record);
	}


}
